package com.afdor.rws.event.driven.channel.rocketmq.config;

import com.afdor.rws.annotation.extension.Extension;
import com.afdor.rws.annotation.extension.SPI;
import com.afdor.rws.event.driven.channel.rocketmq.utils.RocketMqUtils;
import com.afdor.rws.event.driven.config.EventConfig;
import lombok.Data;

import java.io.Serializable;

/**
 * RocketMq相关配置信息<br/>
 * Extension : singleton
 *
 * @author 悭梵
 * @date Created in 2018-12-13 11:21
 */
@Data
@SPI(RocketMqUtils.DEFAULT_COMPONENT_CONFIG_EXTENSION_NAME)
@Extension(value = RocketMqUtils.DEFAULT_COMPONENT_CONFIG_EXTENSION_NAME, scope = Extension.Scope.SINGLETON, interfaceClass = EventConfig.class)
public class RocketMqEventConfig extends EventConfig implements Serializable, Cloneable {
    /**
     * name service 地址
     */
    private String namesrvAddr;
    /**
     * 默认主题队列数量
     */
    private int defaultTopicQueueNums = 4;
    /**
     * 是否顺序消费
     */
    private boolean orderlyConsumer = false;

    /**
     * 生产者核心线程数量
     */
    private int corePoolSize = 4;
    /**
     * 生产者最大线程数量
     */
    private int maxPoolSize = 10;
    /**
     * 生产者队列长度
     */
    private int queueSize = Integer.MAX_VALUE - 1;
    /**
     * 生成者线程名称前缀
     */
    private String threadNamePrefix = "transaction-msg-check-";

}
